using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Domain.Entidades;

namespace Data.Models.Mapping
{
    public class conteudoMap : EntityTypeConfiguration<conteudo>
    {
        public conteudoMap()
        {
            // Primary Key
            this.HasKey(t => t.cont_codigo);

            // Properties
            this.Property(t => t.cont_descricao)
                .IsRequired();

            this.Property(t => t.cont_caminho)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.cont_titulo)
                .IsRequired()
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("conteudo");
            this.Property(t => t.cont_codigo).HasColumnName("cont_codigo");
            this.Property(t => t.cont_descricao).HasColumnName("cont_descricao");
            this.Property(t => t.cont_submenu).HasColumnName("cont_submenu");
            this.Property(t => t.cont_caminho).HasColumnName("cont_caminho");
            this.Property(t => t.cont_titulo).HasColumnName("cont_titulo");
        }
    }
}
